// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#ifndef _AFX_STDAFX_H__
#define _AFX_STDAFX_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning( disable: 4786 ) // identifier was trucated to '255' characters in the debug information

//---- detecting memory leaks
//#define _CRTDBG_MAP_ALLOC
//#include <stdlib.h>
//#include <crtdbg.h>

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include "Winsock2.h"		// socket extensions

#include "../Common/cTimeMark.h"
#include "../RMSLib/info.h"
#include "../RMSLib/registration.h"
#include "../RMSLib/registry.h"

#include <afxmt.h>			// MFC mutex extensions



////////////////////////////////////////////////////////////////////////////////
// Call a function, returning if the result failed

static const char BASED_CODE szCheckFmt[] = "%s(%ld) Runtime error %08lx\r\n";
#define CHECK
#undef CHECK
#ifdef _DEBUG	
#	define CHECK(_fn) \
	{	HRESULT __hr = _fn; \
		if (!SUCCEEDED(__hr)) { \
			TRACE( szCheckFmt, THIS_FILE, __LINE__, __hr ); \
			return __hr; } }
#else
#	define CHECK(_fn) \
		_fn;
#endif


// define _OEM_  - OEM version of VC 10
#ifdef _QFI_
#define _OEM_
#elif  _VITAL_
#define _OEM_
#elif _TEC_
#define _OEM_
#endif

/*
#ifdef _OEM_
#define EXPIRED
#endif
*/

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif 
